//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { CodelabsAlgorithm, CodelabsAlgorithmResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCodelabsAlgorithmList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CodelabsAlgorithmResponse>(`/uctoo/codelabs_algorithm/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCodelabsAlgorithm = async (id: string) => {
  return requestClient.get<CodelabsAlgorithm>(`/uctoo/codelabs_algorithm/${id}`);
};

export const adductooCodelabsAlgorithm = async (data: Partial<CodelabsAlgorithm>) => {
  return requestClient.post<CodelabsAlgorithm>('/uctoo/codelabs_algorithm/add', data);
};

export const edituctooCodelabsAlgorithm = async (data: Partial<CodelabsAlgorithm>) => {
  return requestClient.post<CodelabsAlgorithm>('/uctoo/codelabs_algorithm/edit', data);
};

export const deleteuctooCodelabsAlgorithm = async (id: string) => {
  return requestClient.post<any>('/uctoo/codelabs_algorithm/del', { id });
};
